---
title: Hazard group equality and identity
summary: Compares hazard groups by identity (HazardGroupID).
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Business.Policy
reference_type: package
operation_id: op-16-hazard-group-equality
trigger: Equals/GetHashCode/ToString call
---

# Hazard group equality and identity

Compares `clsHazardGroup` instances by identity, using `HazardGroupID` alone.

| Field | Value |
| --- | --- |
| **Operation ID** | op-16-hazard-group-equality |
| **Trigger** | `Equals`/`GetHashCode`/`ToString` call |
| **Inputs** | `clsHazardGroup` instance(s) |
| **Outputs** | `Boolean` / hash / string |
| **Primary components** | `clsHazardGroup.Equals` (three overloads), `.GetHashCode`, `.ToString` |
| **Entry point** | SAIF.Business.Policy/clsHazardGroup.vb |

## Steps

1. Identity is `HazardGroupID` alone ([BR-POL-003](../business-rules.md#br-pol-003-hazard-group-identity)); non-`clsHazardGroup` operands return `False`.
2. `ToString` returns the id.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Caller invokes Equals /<br>GetHashCode / ToString"]) --> TypeCheck{Operand is<br>clsHazardGroup?}
	TypeCheck -->|No| ReturnFalse(["Return False"])
	TypeCheck -->|Yes| Identity["Compare/hash based on<br>HazardGroupID alone"]
	Identity --> ToStringCheck{ToString called?}
	ToStringCheck -->|Yes| ReturnId(["Return HazardGroupID<br>as string"])
	ToStringCheck -->|No| ReturnResult(["Return Equals /<br>GetHashCode result"])
```

## Failure and edge-case behavior
- Non-`clsHazardGroup` operands passed to `Equals` return `False` rather than throwing a type-mismatch exception ([BR-POL-003](../business-rules.md#br-pol-003-hazard-group-identity)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Business.Policy/clsHazardGroup.vb`
